﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ugrow_silverlight.Buy_Kit
{
    public partial class BuyKit : UserControl
    {
        private Brush color;
        private Boolean clicked4 = false;
        private Boolean clicked7 = false;
        
        public BuyKit()
        {
            InitializeComponent();
            color = l_4reag.Foreground;
            l_4reag.Foreground = new SolidColorBrush(Colors.Black);
        }

        private void l_4reag_MouseEnter(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Hand;
            l_4reag.Foreground = color;
        }

        private void l_4reag_MouseLeave(object sender, MouseEventArgs e)
        {
            if(!clicked4)
                l_4reag.Foreground = new SolidColorBrush(Colors.Black);
            Cursor = Cursors.Arrow;
        }

        private void l_4reag_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            l_4reag.Foreground = color;
            l_7reag.Foreground = new SolidColorBrush(Colors.Black);
            img_4reag.Visibility = System.Windows.Visibility.Visible;
            img_7reag.Visibility = System.Windows.Visibility.Collapsed;
            l_buy.Visibility = System.Windows.Visibility.Visible;
            clicked7 = false;
            clicked4 = true;
        }

        private void l_7reag_MouseEnter(object sender, MouseEventArgs e)
        {
            Cursor = Cursors.Hand;
            l_7reag.Foreground = color;
        }

        private void l_7reag_MouseLeave(object sender, MouseEventArgs e)
        {
            if(!clicked7)
                l_7reag.Foreground = new SolidColorBrush(Colors.Black);
            Cursor = Cursors.Arrow;
        }

        private void l_7reag_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            l_7reag.Foreground = color;
            l_4reag.Foreground = new SolidColorBrush(Colors.Black);
            img_7reag.Visibility = System.Windows.Visibility.Visible;
            img_4reag.Visibility = System.Windows.Visibility.Collapsed;
            l_buy.Visibility = System.Windows.Visibility.Visible;
            clicked4 = false;
            clicked7 = true;
        }

        private void l_buy_MouseEnter(object sender, MouseEventArgs e)
        {
            l_buy.Foreground = new SolidColorBrush(Colors.Orange);
            Cursor = Cursors.Hand;
        }

        private void l_buy_MouseLeave(object sender, MouseEventArgs e)
        {
            l_buy.Foreground = new SolidColorBrush(Colors.White);
            Cursor = Cursors.Arrow;
        }

        private void l_buy_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MessageBox.Show("Thank you for purchasing.");
        }

        public void ClearFields()
        {
            l_buy.Visibility = System.Windows.Visibility.Collapsed;
            l_4reag.Foreground = new SolidColorBrush(Colors.Black);
            l_7reag.Foreground = new SolidColorBrush(Colors.Black);
            img_4reag.Visibility = System.Windows.Visibility.Collapsed;
            img_7reag.Visibility = System.Windows.Visibility.Collapsed;
        }        
    }
}
